vcScope

Scope is a collection of statements in a program.

See in: Overview

Module: vcExecutor

Parent: vcObject

Children: vcRoutine, vcElseIfScope

Referenced by: vcIfStatement.ElseScope, vcIfStatement.ThenScope, vcProcessIfStatement.ElseScope, vcProcessIfStatement.ThenScope, ... (see more)
vcIfStatement.ElseScope
vcIfStatement.ThenScope
vcProcessIfStatement.ElseScope
vcProcessIfStatement.ThenScope
vcProcessWhileStatement.Scope
vcScopeStatement.Scope
vcStatement.ParentScope
vcStatement.Scopes
vcStatementHelper.GetActiveScope()

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
ParentStatementvcStatementRGets the statement that owns the scope, for example a conditional If or While statement
that has a nested block of statements; otherwise the value is None for routines.
StatementsvcObservableList[vcStatement]RGets a list of statements belonging to the scope.

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
clearNoneNoneDeletes all statements in the scope.
createStatementvcStatementvcStatementType statementType,
Optional Keyword[index = Integer]
Creates a new statement of a given type in the scope.
See more
Parameters:
statementType (vcStatementType): Type for the statement to be created.
Optional: index (Integer): Index for the new statement. The default index value is -1 which adds the new statement to the end of the scope.

Exceptions:
ValueError: When creating a break or continue statement type outside of a loop.
ValueError: When statement is non-requirement statement and added to requirement statement scope.
ValueError: When statement is requirement statement and added to non-requirement statement scope.
ValueError: When creating a non-process statement in a process executor.
ValueError: When creating a process statement in a robot executor.

Returns:
vcStatement: Created statement.
moveStatementNonevcStatement statement,
Integer newIndex
Moves statement to different index in list.

Events

Learn how to use events here. The events are also inherited from the parent class.

NameParametersDescription
OnScopeExecutedbool isImmediateTriggered when a scope is executed.
See more
Parameters:
isImmediate (bool): Defines whether the scope was executed in immediate mode (non time-consuming mode) or not.